//
//  UILabel+UILabel_LabelHeightAndWidth.m
//  CenturyInterconnection
//
//  Created by l-sheng on 6/18/16.
//  Copyright © 2016 Shanghai DuRui Information Technology Company. All rights reserved.
//

#import "UILabel+UILabel_LabelHeightAndWidth.h"

@implementation UILabel (UILabel_LabelHeightAndWidth)



//高度
+ (CGFloat)getHeightByWidth:(CGFloat)width titile:(NSString *)title font:(UIFont *)font
{
    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, 0)];
    label.text = title;
    label.font = font;
    label.numberOfLines = 0;
    [label sizeToFit];
    CGFloat height = label.frame.size.height;
    return height;
}


//宽度
+ (CGFloat)getWidthWithTitle:(NSString *)title font:(UIFont *)font
{
    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 1000, 0)];
    label.text = title;
    label.font = font;
    [label sizeToFit];
    return label.frame.size.width;
}



@end
